using Localization.Resources.AbpUi;

using Microsoft.Extensions.DependencyInjection;

using Volo.Abp.AspNetCore.Components.Web.Theming;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.BlazoriseUI;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;

using WL.Think.Abp.Modules;
using WL.Think.Abp.OpenIddict.Blazor.Menu;
using WL.Think.Abp.OpenIddict.Localization;

namespace WL.Think.Abp.OpenIddict.Blazor
{
    [DependsOn(
        typeof(ThinkAbpOpenIddictHttpApiModule),
        typeof(AbpAspNetCoreComponentsWebThemingModule),
        typeof(AbpBlazoriseUIModule)
    )]
    public class ThinkAbpOpenIddictBlazorModule : ThinkModule<ThinkAbpOpenIddictBlazorModule>
    {
        protected override void ConfigureMenu(ServiceConfigurationContext context)
        {
            Configure<AbpNavigationOptions>(options =>
            {
                options.MenuContributors.Add(new ThinkAbpOpenIddictMenuContributor());
            });
        }

        protected override void ConfigureRouter(ServiceConfigurationContext context)
        {
            Configure<AbpRouterOptions>(options =>
            {
                options.AdditionalAssemblies.Add(typeof(ThinkAbpOpenIddictBlazorModule).Assembly);
            });
        }

        protected override void ConfigureAutoMapper(ServiceConfigurationContext context)
        {
            context.Services.AddAutoMapperObjectMapper<ThinkAbpOpenIddictBlazorModule>();
        }
    }
}
